﻿@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IStringLocalizer<BootstrapBlazor.Shared.Samples.Menus> Localizer

<div class="layout-menu-demo">
    <Layout SideWidth="0" IsFullSide="true" ShowFooter="true" ShowCollapseBar="true" Menus="IconSideMenuItems">
        <Header>
            <div class="menu-demo-header">
                @Localizer["MenusClickShrinkSpanSpan"]
            </div>
        </Header>
        <Side>
            <div class="layout-banner">
                <img class="layout-logo" src="_content/BootstrapBlazor.Shared/images/logo.png" />
                <div class="layout-title">
                    <span>@Localizer["MenusClickShrinkMenuTitle"]</span>
                </div>
            </div>
        </Side>
        <Main>
            <div style="padding: 10rem 1rem;">Main</div>
        </Main>
        <Footer>
            <a href="@WebsiteOption.CurrentValue.BootstrapAdminLink" target="_blank">Bootstrap Admin</a>
        </Footer>
    </Layout>
</div>

@code {
    [NotNull]
    private IEnumerable<MenuItem>? IconSideMenuItems { get; set; }

    /// <summary>
    /// OnInitialized 方法
    /// </summary>
    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();

        IconSideMenuItems = await MenusDataGerator.GetIconSideMenuItemsAsync(Localizer);
    }
}
